<?php include_once($_SERVER['DOCUMENT_ROOT']."/controller/common/common_setting_unit.php");         // 引入通用的设置文件 ?>
<?php include_once($_SERVER['DOCUMENT_ROOT']."/controller/common/module/head.php"); // 引入通用的头部 ?>
<?php include_once("../controller/detail-list.php");                     // 当前页面的控制器 ?>



<body>

<div id="topbar">
    <?php include ROOT_PATH_.'/controller/common/module/topbar.php'; ?>
</div>

<div id="container" class="<? echo $system_part ?>">

    <div id="maincontent">

        <div id="sidebar">
            <?php include ROOT_PATH_.'/controller/common/module/sidebar.php'; ?>
        </div>


<div id="content">
<?php $page_title='订单列表';?>
<?php include ROOT_PATH_.'/controller/common/module/mod-page-title.php'; ?>

	<?php include 'module/mod-search.php'; ?>


    <hr />

<!-- 用$system_part .list_boxes来控制来到确认板块信息显示-->
<div class="list-box">

<div class="list-boxes">

<table class="layui-table">
  <colgroup>
    <col width="60">
	<col >
	<col >
	<col >
	<col >
	<col >
	<col >
	<col >
	<col >
	<col >

  </colgroup>
  <thead>
    <tr>

      <th>序号</th>
      <th>产品名</th>
      <th>订单号</th>
      <th>价格</th>
      <th>订单状态</th>
      <th>付款状态</th>
      <th>下单时间</th>
      <th>用户</th>
      <th>微信支付id</th>
      <th>操作</th>
    </tr>
  </thead>
  <tbody>

  <?php

  if ($detailnum == 0) {
      echo "<tr><td colspan='6'>暂无数据</td></tr>";
  }

  ?>


	<?php
	for ($i = 0; $i < $detailnum; $i++) {


    ?>

    <tr id="item<?echo $detail[$i]['order_id']?>" >
        <td><?echo $i + 1 ?></td>
<!--      <td><input type="checkbox" value="--><?//echo $detail[$i]['nid']?><!--" name="nid[]" class="" ></td>-->
        <td><? echo $detail[$i]['order_name']?></td>
        <td><? echo $detail[$i]['order_sn']?></td>
        <td><? echo $detail[$i]['order_price']?></td>
        <td><? echo $detail[$i]['order_status'] == 1 ? '已确认':'已取消';?></td>
        <td><? echo $detail[$i]['pay_status'] == 2 ?  $detail[$i]['pay_status'] == 2 ? '已退款':'待退款' : '已付款';?></td>
        <td><? echo $detail[$i]['add_date']?></td>
        <td><? echo $detail[$i]['nickname']?></td>
        <td><? echo $detail[$i]['transaction_id']?></td>
        <td>
            <a onclick="window_eject('data_info_window.php?<? echo $data['url_parameter'] ?>&nid=<? echo $detail[$i]['nid'] ?>')"
               class="layui-btn  layui-btn-sm">
                <i class="fa fa-bar-chart-o" aria-hidden="true"></i>信息
            </a>
 </td>
    </tr>
  <?php

}
?>
  </tbody>
</table>

</div>







    <div class="list-box-function"
        <? if ($detailnum == 0) {
            echo "style" . "='display:none'";
        } ?>
        >

        <?php include 'module/page_numbers.php'; ?>

    </div>
</div>


<!--list-box end-->
</div>

<!--content端點01-->
</div>
<!--maincontent端點01-->
<br class="clearfloat"/>
</div>
<!--container端點01-->
</div>




<script>



    function canItem (id) {

        con=confirm("确认取消订单?");
        if(con==true){

			if(!id > 0 ){
				layer.msg('请刷新后再操作！');
				return false;
			}


			$.ajax({
				type:"POST",
				url:"cancel.php",
				dateType:"json",
				data:{"nid":id},
                dataType:"json",
				beforeSend: function () {
                      layer.msg('正在检查状态中');

               	},
				success:function(data){

						if(data.error == 1){
							layer.msg(data.content, {icon: 2});
						}
						else if(data.error == 0){
							layer.msg(data.content, {icon: 1});
							$('#item'+id).find('.state').html('取消')
							$('#item'+id).find('.cancel_order').remove()
						}

				}
			})


        }

    }

</script>


<!--删除box-->
<?php include '../module/deletebar.php'; ?>
<!--删除box end-->


<!--载入弹出窗口功能-->
<script type="text/javascript" src="/controller/common/asset/js/window_eject.js"></script>


<?php include ROOT_PATH_ . "/controller/common/module/footer.php"; ?>
</body>
</html>
